<template>
    <div>
        <h3>主页组件</h3>
        <!-- 轮播图区域 -->
        <!-- <mt-swipe :auto="4000">
            <mt-swipe-item>1</mt-swipe-item>
            <mt-swipe-item>2</mt-swipe-item>
            <mt-swipe-item>3</mt-swipe-item>
        </mt-swipe> -->
		<swiper></swiper>
        <!-- <mt-swipe :auto="4000">
            <mt-swipe-item v-for="item in lunbotuList" :key="item.url">
                <img :src="item.img" alt="" />
            </mt-swipe-item>
        </mt-swipe> -->

        <!-- 九宫格的改造 -->
        <ul class="mui-table-view mui-grid-view mui-grid-9">
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
                <router-link to="/home/newList">
                    <span class="mui-icon mui-icon-home"></span>
                    <div class="mui-media-body">News</div>
                </router-link>
            </li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
                <router-link to="/home/photosList">
                    <span class="mui-icon mui-icon-email"><span class="mui-badge">5</span></span>
                    <div class="mui-media-body">资讯</div>
                </router-link>
            </li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
                <router-link to="/home/goodsList">
                    <span class="mui-icon mui-icon-chatbubble"></span>
                    <div class="mui-media-body">商品</div>
                </router-link>
            </li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
                <a href="#">
                    <span class="mui-icon mui-icon-location"></span>
                    <div class="mui-media-body">location</div>
                </a>
            </li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
                <a href="#">
                    <span class="mui-icon mui-icon-search"></span>
                    <div class="mui-media-body">Search</div>
                </a>
            </li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4">
                <a href="#">
                    <span class="mui-icon mui-icon-phone"></span>
                    <div class="mui-media-body">Phone</div>
                </a>
            </li>
        </ul>
    </div>
</template>

<script>
	// 导入组件1.
	import swiper from '../subcomponents/swiper.vue'
	
export default {
    data() {
        return {
            lunbotuList: [] //保存了后台传回来的数据
        };
    },
    created() {
        this.getLunbotu()
    },
    methods: {
        getLunbotu() {
			console.log(111)
            //获取轮播图数据的方法
            this.$axios.get("/api/app/machineInfo/queryMachineList").then(result => {
                console.log(result)
                if (result.body.status == 0) {
                    this.lunbotuList = result.body.message;
                }else {
                    // Toast('')弹窗组件
                }
            })
        }
    },
	components:{
		swiper
	}
}
</script>

<style scoped>
.mint-swipe{
    height: 200px;
}
.mint-swipe-item:nth-child(1) {
    background-color: skyblue;
}
.mint-swipe-item:nth-child(2) {
    background-color: cyan;
}
.mint-swipe-item:nth-child(3) {
    background-color: blue;
}
</style>